Name "Excersize in Immesrion IV"
OutFile "LightMapBlend.exe"
InstallDir "C:\Program Files\EI4_BlendLightmaps\"
Icon "..\resources\EiPacman.ico"
UninstallIcon "..\resources\EiPacman.ico"

Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles

Section "ei4"
        SetOutPath $INSTDIR
        File D:\Projecten\TextureTest\TextureTest.exe
        File /x *_d.*  D:\Projecten\EImmersion4\Ei4\SDK\lib\*.dll
        # resources
        SetOutPath $INSTDIR\resources
        File /r /x .svn ..\resources\*.*
        # lua scripts
        SetOutPath $INSTDIR\lua
        File ..\lua\*.*
        # uninstaller
        WriteUninstaller $INSTDIR\uninstall.exe
        # Start menu
        SetOutPath $INSTDIR # will be working directory for the menu links
        CreateDirectory "$SMPROGRAMS\Excersize in Immersion IV"
        CreateShortCut  "$SMPROGRAMS\Excersize in Immersion IV\Blend Lightmaps.lnk" \
                "$INSTDIR\TextureTest.exe" \
                "lua\config.lua lua\monowin.lua resources\media\Lightblend\PakHuis.OSM"
        CreateShortCut  "$SMPROGRAMS\Excersize in Immersion IV\Uninstall.lnk" \
                "$INSTDIR\uninstall.exe"	       
        # Register uninstaller with "Add/Remove Programs"
        WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ei4" \
                 "DisplayName" "Excersize in Immersion IV Game Engine"
        WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ei4" \
                 "UninstallString" "$INSTDIR\uninstall.exe"
SectionEnd

Section "Uninstall"
        Delete $INSTDIR\lua\*.*
        RMDir  $INSTDIR\lua 
        Delete $INSTDIR\resources\media\Lightblend\*.*
        RMDir  $INSTDIR\resources\media\Lightblend
        Delete $INSTDIR\resources\media\gui\*.*
        RMDir  $INSTDIR\resources\media\gui
        Delete $INSTDIR\resources\media\shaders\*.*
        RMDir  $INSTDIR\resources\media\shaders
        RMDir  $INSTDIR\resources\media
        Delete $INSTDIR\resources\*.*
        RMDir  $INSTDIR\resources
        Delete $INSTDIR\*.*
        RMDir  $INSTDIR
        # remove the menu
        Delete "$SMPROGRAMS\Excersize in Immersion IV\*.*"
        RMDir  "$SMPROGRAMS\Excersize in Immersion IV"
        # Clean the registry
        DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ei4"
SectionEnd
